<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePatentAssessesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('patent_assesses', function (Blueprint $table) {
            $table->id();
            $table->integer('patent_apply_id');
            $table->integer('expert_id');

            $table->float('score')->default(0);
            $table->string('path')->nullable()->comment('评估报告');
            $table->text('remark')->nullable();

            $table->tinyInteger('state')->default(0);

            $table->timestamps();

            $table->index('expert_id');
            $table->index('patent_apply_id');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('patent_assesses');
    }
}
